package edu.java.lectures.lec09.exceptions.throwing;

public class ExceptionWrappingExample {

    public static void main(String[] args) {
	// try {
	doSomething2();
	// } catch (Exception e) {
	// e.printStackTrace();
	// }
    }

    public static void doSomething2() {
	try {
	    doSomething1();
	} catch (Exception e) {
	    // exception wrapping
	    IllegalStateException ise = new IllegalStateException(
		    "Problem during the execution of method doSomething1().", e);
	    throw ise;
	}
    }

    public static void doSomething1() throws Exception {
	throw new Exception("Exceptional event in doSomething1().");
    }
}
